//
//  BaseHeadView.m
//  Cat
//
//  Created by dllo on 15/11/30.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "BaseHeadView.h"
@implementation BaseHeadView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self createView];
    }
    return self;
}

- (void)createView {
    self.myImageView = [[UIImageView alloc] init];
    [self addSubview:self.myImageView];
    self.titleLabel = [[UILabel alloc] init];
    [self addSubview:self.titleLabel];
    self.descrLabel = [[UILabel alloc] init];
    [self addSubview:self.descrLabel];
    self.commentsLabel = [[UILabel alloc] init];
    [self addSubview:self.commentsLabel];
    
    [self.myImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(0);
        make.right.equalTo(self.mas_right).offset(0);
        make.top.equalTo(self.mas_top).with.offset(0);
        make.height.mas_equalTo(VIEW_HEIGHT/4);
        
    }];
    self.titleLabel.font = [UIFont systemFontOfSize:15];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(10);
        make.top.equalTo(self.myImageView.mas_bottom).offset(10);
        make.right.equalTo(self.mas_right).offset(-10);
        make.height.mas_equalTo(20);
        
    }];
    
    self.commentsLabel.font = [UIFont systemFontOfSize:12];
    self.commentsLabel.textColor = [UIColor grayColor];
    [self.commentsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.mas_left).offset(10);
        make.top.equalTo(self.titleLabel.mas_bottom).offset(0);
        make.right.equalTo(self.mas_right).offset(-10);
        make.height.mas_equalTo(15);
    }];

    self.descrLabel.numberOfLines = 0;
}


@end
